Socket
Socket
Sign inDemoInstall

expand-args

Package Overview
Dependencies
31
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    expand-args

Expand parsed command line arguments using expand-object.


Version published
Weekly downloads
37K
decreased by-8.05%
Maintainers
1
Install size
295 kB
Created
Weekly downloads
 

Readme

Source

expand-args NPM version Build Status

Expand parsed command line arguments using expand-object.

Example

var minimist = require('minimist');
var expandArgs = require('expand-args');

var argv = minimist(['--set=a:b,c:d']);
//=> { _: [], set: 'a:b,c:d' }

expandArgs(argv);
//=> { _: [], set: [{ a: 'b' }, { c: 'd' }] }

Visit expand-object to see the full range of options and features or to create expansion-related issues.

Install

Install with npm:

$ npm i expand-args --save

Usage

var expandArgs = require('expand-args');

expand args to object values

expandArgs({set: 'a:b'})
//=> {set: {a: 'b'}}

expandArgs({set: 'a.b.c:d'})
//=> {set: {a: {b: {c: 'd'}}}}

expand args to array values

expandArgs({set: 'a:b,c:d'})
//=> {set: [{a: 'b'}, {c: 'd'}]}

expandArgs({set: 'a.b.c:d,e,f'})
//=> {set: {a: {b: {c: ['d', 'e', 'f']}}}}

Convert "object-keys"

expandArgs({'a:b': true})
//=> {a: 'b'}

Expand booleans

expandArgs({set: 'a|b'});
//=> {set: {a: true, b: true}}
  • expand-object: Expand a string into a JavaScript object using a simple notation. Use the CLI or… more | homepage
  • map-config: Map configuration objects to application methods. | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2016 Jon Schlinkert Released under the MIT license.


This file was generated by verb, v0.9.0, on February 11, 2016.

Keywords

FAQs

Last updated on 11 Feb 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc